<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>时间转换指令</title>
  </head>
  <body>
    <div id="app" v-cloak>
      <div v-time="timeNow"></div>
      <div v-time="timeBefore"></div>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.min.js"></script>
    <script src="time.js"></script>
    <script type="text/javascript">
      var app = new Vue({
        el: '#app',
        data: {
          timeNow: (new Date()).getTime(),
          timeBefore: 1488930695721,  // 2017-3-8
        },
        methods: {
          handleClose() {
            this.show = false;
          }
        },
      })
    </script>
  </body>
</html>